<?php if(!IS_AJAX){?>
<include file="Public:header" />
<style>
.table-custom { border: 1px solid #ccc; border-collapse: separate; border-radius: 5px; overflow: hidden; }
.table-custom tr { color: #666; }
.table-custom thead th { background: linear-gradient(to bottom, #fdfdfd 30%, #e9e9e9); text-align: center; }
.table-custom tr img { border: 1px solid #ccc; margin-right: 5px; }
.table-custom tr .social-links { margin: 5px 0; }
.table-custom tr .social-links a { margin-right: 5px; }
.table-bordered th{border-bottom: none!important;}
.table td{vertical-align: middle!important;}
.btn-ccc{border:1px solid #ccc;color:#000;}
.btn-ccc:hover{background:#fafafa;}
.mg-ul a{color:#fff;padding:6px 10px}
.all-in-all a{color:#000;}
.limit_h_23{ overflow:hidden; max-height:23px;}
</style>
<div class="row">
    <div class="col-sm-12 col-md-12 col-lg-12">
        <!--添加界面引导 BY zmx-->
        <div class="panel " data-position="right" data-intro="角色就是对所有人进行权限分组，系统默认有四个权限组（角色），分别对应四种不同权限级别，管理员可以修改，也可以添加自定义权限组（角色），权限组（角色）开启后才起作用">
            <div class="panel-heading">
                <span class="pagetitle">角色管理</span>
            </div>
            <div class="panel-body" style="padding-top:0">
                <!---->
                <div style="margin:10px 0;">
                    <div style="float:left;" class="all-in-all">
                        <a href="##" class="btn" id="ajaxlistboxbob" style="float:left;margin-right:5px;border:1px solid #ccc;">批量操作</a>
                        <div class="form-group" id="ajaxlistboxboc" style="display:none;float:left;margin-bottom: 0;color:#fff"><a href="##" class="btn btn-ccc" id="ajaxlistboxsa">全选</a> <a href="##" class="btn btn-ccc" id="ajaxlistboxca">全不选</a> <a href="##" class="btn btn-ccc" id="ajaxlistboxsar">反选</a> <a rel="{:U('delete')}" href="##" class="btn btn-ccc bdeleteBtn" style="margin-right:5px">删除选中</a></div>
                        <div class="clearfix"></div>
                    </div>
                    <div style="float:right;">
                        <div style="width:210px;float: left;">
                            <form id="ajaxlistboxform" action="<?php echo U('index');?>">
                                <input type="hidden" name="status" value="-999">
                                <div class="input-group">
                                    <input type="text" name="keywords" class="form-control" placeholder="搜索关键词">
                                      <span class="input-group-btn">
                                        <button type="button" onClick="$('#ajaxlistboxform').submit();" class="btn btn-default"><i class="fa icon-search"></i></button>
                                      </span>
                                </div>
                            </form>
                        </div>
                        <div style="float:left;">
                            <a href="javascript:void(0)" rel="<?php echo U('add'); ?>"  id="ajaxlistboxaddbtn"  class="btn btn-success" style="color:#fff;margin-left:15px;" title="增加角色">增加角色</a>
                        </div>
                    </div>
                    <div class="clearfix"></div>
                </div>

                <!---->
                <div class="directory-info-row" style="margin-top:0;">
                    <table  class="display table table-hover table-bordered table-striped">
                    <thead>
                    <tr>
                        <th style="text-align:center;display:none;">勾选</th>
                        <th>角色名称</th>
                        <th class="hidden-xs">权限说明</th>
                        <th style="text-align:center">状态</th>
                        <th style="text-align:center">操作</th>
                    </tr>
                    </thead>
                    <tbody  id="ajaxlistbox">
                    <?php }?>
                    <?php if(IS_AJAX){?>
                    <notempty name="pid_list">
                        <volist name="pid_list" id="vo">
                            <tr class="data_list " id="ajaxlistbox-{$vo.id}">
                                <td align="center" style="position:relative; display:none;"><div class="BatchOperation BatchOperationBtn td">
                                    <input class="checkbox" type="checkbox" name="id[]" value="{$vo.id}">
                                    <i class="fa icon-check td" style="border:1px solid #aaa;"></i>
                                    <div class="fabg td">
                                    </div>
                                </div></td>
                                <td class="box-elli" style="text-indent:{$vo['cl']*10}px"><gt name="vo['cl']" value="0">|-</gt>
                                    {$vo.title}</td>
                                <td class="hidden-xs"><div class="limit_h_23">{$vo.remark}</div></td>
                                <td class="box-elli" align="center" title="状态开关">
                                    <span class="tooltips"  data-original-title="点击<eq name="vo['status']" value="1">关闭
                                    <else/>
                                    开启
                                    </eq>
                                    " data-placement="top" data-toggle="tooltip" >
                                    <input updateurl="{:U('ajaxUpdate')}" field="status,{$vo.id}" type="checkbox"

                                    <eq name="vo['status']" value="1">checked="checked"</eq>
                                    class="js-switch-teal"/>
                                    </span>
                                </td>
                                <td align="center" class="mg-ul box-elli">
                                    <if condition="getAccessMenu($accessList, 'Intesys', 'Member_access', 'index')">
                                            <a  href="javascript:void(0);" class="btn btn-success OptionBtn" rel="{:U('Member_access/index',array('role_id'=>$vo['id']))}" title="授权"  source=".main-content > .wrapper">授权</a>
                                    </if>
                                            <a  href="javascript:void(0);" class="btn btn-success OptionBtn"   rel="{:U('edit',array('id'=>$vo['id']))}" title="修改角色信息" >修改</a>
                                            <a  href="javascript:void(0);" class="btn btn-success deleteBtn"  rel="{:U('delete',array('id'=>$vo['id']))}" title="删除" >删除</a>
                                            <!--<a source=".main-content > .wrapper" class="OptionBtn tooltips"  data-original-title="授权" title="授权" data-placement="top" data-toggle="tooltip" href="javascript:void(0);"  rel="{:U('Member_access/index',array('role_id'=>$vo['id']))}"  width="100%"><i class="fa icon-exclamation-circle"></i>-->
                                            <!--</a>-->
                                            <!--<a class="OptionBtn tooltips"  data-original-title="修改" data-placement="top" data-toggle="tooltip" href="javascript:void(0);"   rel="{:U('edit',array('id'=>$vo['id']))}" title="修改角色信息" >-->
                                                <!--<i class="fa icon-edit"></i>-->
                                            <!--</a>-->
                                            <!--<a rel="{:U('delete',array('id'=>$vo['id']))}" data-id="{$vo.id}" class="deleteBtn tooltips"  data-original-title="删除" title="删除" data-placement="top" data-toggle="tooltip" href="javascript:void(0);">-->
                                                <!--<i class="fa icon-trash-o"></i>-->
                                            <!--</a>-->
                                </td>
                            </tr>
                        </volist>
                        <else/>
                        <tr>
                            <td colspan="4">暂无数据</td>
                        </tr>
                    </notempty>
                    <?php }?>
                    <?php if(!IS_AJAX){?>
                    </tbody>
                </table>
                </div>
                <div class="PagesBox" id="ajaxlistboxpages">
                </div>
            </div>
        </div>
    </div>
</div>
<include file="Public:script" />
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/Js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/Js/ueditor/ueditor.all.min.js"> </script>
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/Js/ueditor/lang/zh-cn/zh-cn.js"></script>
<script>
    $('#ajaxlistbox').ajaxlist({loading:'<tr><td colspan="4"><div class="lockwindowlayout" id="lockwindowlayout" style="overflow:hidden; padding:10px 0;"><div class="loader-inner line-scale" style="text-align:center;"><div></div><div></div><div></div><div></div><div></div></div><style>.lockwindowlayout .line-scale{height:20px;}.lockwindowlayout .line-scale div{background:#5ec8ff; height:20px;}</style></div></td></tr>',success:function(){ $('[data-toggle="tooltip"]').tooltip();  }});
	$("#ajaxlistbox").on("click",".switchery",function(){
		var tool=$(this).parents(".tooltips");
		var title=tool.attr("data-original-title");	
		if(title.indexOf('关闭')==-1){
			title=title.replace('开启','关闭');	
		}else{
			title=title.replace('关闭','开启');	
		}
		tool.attr("data-original-title",title);
		$(".tooltip-inner").html(title);
	});
</script>
</body></html><?php }?>